package sc
package test

object test3 {
  def main(args: Array[String]): Unit = {
    val dog1 = dog("wert", 11,"ew2iiwr")
    println(dog1._name)
    def fun(d:dog=>Int): Int = {
      d(dog1)*2
    }
    def d(d:dog):Int ={
      d._age%20
    }
    println(fun(d))
  }
  var ct : cat = cat("m4ydse",13,"cat")
  println(ct)
  val list: List[Int] = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

}
class dog(name: String, age: Int) {
  val _name = name
  val _age = age
  var _desc:String =_
  def this(name:String,age:Int,desc:String) {
    this(name, age)
    _desc = desc
  }

}
object dog {
  var i : Int =_
  def apply(name: String, age: Int, desc: String): dog = {
    new dog(name, age, desc)
  }
}
case class cat(name: String, age: Int, desc: String){

}
object cat{
  def apply(name: String, age: Int, desc: String): cat = {
    new cat(name, age, desc)
  }
}